package com.mdxx.xczd.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import com.mdxx.xczd.app.App;


/**
 * 电量广播 20161012
 */
public class BatteryReceiver extends BroadcastReceiver {

	@Override
	public void onReceive(Context arg0, Intent intent) {
		if(Intent.ACTION_BATTERY_CHANGED.equals(intent.getAction())){
			int level = intent.getIntExtra("level", 0);
			int scale = intent.getIntExtra("scale", 100);
			App.batteryLevel = (level*100)/scale;
		}
	}
}
